package com.test;

public class ThreadTest2 {
    public static void main(String[] args) {

//        Thread thread01 = new Thread(new RunableInstance2(), "thread01");
//        thread01.start();
        Runnable runnable = ()->{
            int count = 0;
            while (true) {
                count ++;
                System.out.println(count);
                if (count > 50) {
                    break;
                }
            }
        };
        new Thread(runnable).start();
    }
}

//class RunableInstance2 implements Runnable{
//    @Override
//    public void run() {
//        int count = 0;
//        for (int i = 0; i < 200; i++) {
//            count++;
//            System.out.println(count);
//        }
//    }
//}
